package com.yyc.system.service.impl;

import com.yyc.system.dao.TCatalogMapper;
import com.yyc.system.model.TCatalog;
import com.yyc.system.service.ITCatalogService;

import tk.mybatis.mapper.entity.Condition;

import com.yyc.core.AbstractService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


/**
 * Created by yyc on 2019/01/03.
 */
@Service
@Transactional( isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class TCatalogServiceImpl extends AbstractService<TCatalog> implements ITCatalogService {
    @Autowired
    private TCatalogMapper tCatalogMapper;

	@Override
	public List<TCatalog> findCatalogByBookId(Integer id) {
		Condition condition = new Condition(TCatalog.class);
		condition.createCriteria().andEqualTo("bookId", id);
		return this.findByCondition(condition);
	}

}
